use mtdb
GO

DROP TABLE OBJ_META
GO

CREATE TABLE OBJ_META
(
    TENANT_ID NUMERIC(7,0) NOT NULL,
    OBJ_DEF_ID VARCHAR(128) NOT NULL,
    OBJ_DEF_VER NUMERIC(10,0) NOT NULL,
    OBJ_DEF_PATH VARCHAR(894) NOT NULL,
    OBJ_DEF_DISP_NAME NVARCHAR(1024),
    OBJ_DESC NVARCHAR(1024),
    OBJ_META_DATA VARBINARY(MAX) NOT NULL,
    STATUS VARCHAR(1),
    SHARABLE VARCHAR(1),
    OVERWRITABLE VARCHAR(1),
    CRE_USER VARCHAR(64),
    CRE_DATE DATETIME2(3) NOT NULL,
    UP_USER VARCHAR(64),
    UP_DATE DATETIME2(3) NOT NULL,
    CONSTRAINT OBJ_META_PK PRIMARY KEY (TENANT_ID, OBJ_DEF_ID, OBJ_DEF_VER)
)
GO

CREATE INDEX OBJ_META_INDEX1 ON OBJ_META (TENANT_ID, OBJ_DEF_PATH, STATUS)
GO
